<html>
<head><meta charset="utf-8"><title>rust-analyzer public API · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20public.20API.html">rust-analyzer public API</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229475842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20public%20API/near/229475842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shahar Dawn Or <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20public.20API.html#229475842">(Mar 09 2021 at 13:29)</a>:</h4>
<p>I'd like to:</p>
<ol>
<li>Parse Rust code into AST</li>
<li>Mutate that AST</li>
<li>Get back Rust code, even if not nicely formatted.</li>
</ol>
<p>I was advised that rust-analyzer is made with this in mind. But where is the API for this, please? I'm not even sure which crate to look into.</p>



<a name="229475959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20public%20API/near/229475959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20public.20API.html#229475959">(Mar 09 2021 at 13:29)</a>:</h4>
<p>You need the <code>syntax</code> crate (sorry, didn't have a chance to get back to you on telegram yet :( )</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>